<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header','Admin');?>
<form name="myform" action="<?php echo U('listorder'); ?>" method="post">
<div class="pad_10">
<div class="table-list">
    <table width="100%" cellspacing="0" >
        <thead>
            <tr>
            <th>ID</th>
            <th align='center'><?php echo L('username');?></th>
            <th align='center'><?php echo L('convert_name');?></th>            
            <th align='center'><?php echo L('convert_time');?></th>          
            <th align='center'><?php echo L('credit_num');?></th>                                
            <th align='center'><?php echo L('duiuan_type');?></th>                      
            <th align='center'><?php echo L('conver_type');?></th>      
			<th ><?php echo L('operations_manage');?></th>
            </tr>
        </thead>
    <tbody>
   <?php foreach ($tmps as $key => $v) { ?>
   		<tr>
        <td align='center'><?php echo $v['id'] ?><input type="hidden" name="userid" value="<?php echo $v['userid'] ?>"></td>
   			<td align='center'><?php echo $v['consignee'] ?></td>
   			<td align='center'><?php echo $v['name'] ?></td>
   			<td align='center'><?php echo date("Y-m-d H:i:s",$v['time']);?></td>               
        	<td align='center'>
          <?php 
            if($v['credit_type'] == 'bean')
              echo '消耗U豆'.$v['number']; 
            else
              echo '消耗U币'.$v['number']; 
          ?> 
          </td>
        	<td align='center'><?php if($v['status'] == '0') echo '未兑换'; else echo '已兑换'; ?></td>        
        	<td align='center'><?php if($v['shop_type'] == '1' ) echo '虚拟'; else echo '数码';?></td>       			
   			<td align='center'>
        <a href="javascript:edit('<?php echo $v['id']; ?>', '<?php echo safe_replace($v['name']); ?>');void(0);"><?php echo L('verify_type'); ?></a>
        <a href="javascript:deletes(<?php echo $v['id'] ?>)" ><?php echo L('delete_plaform'); ?></a>
        </td>
   		</tr>
   <?php  } ?>
      <tr>
        <td colspan="9" align="right"><?php echo $pages ?></td>
      </tr>
    </tbody>
    </table>
    
</div>
</div>
</form>
</body>
</html>
<script type="text/javascript">
window.top.$('#display_center_id').css('display','none');
function edit(id, title) {
  window.top.art.dialog({id:'edit'}).close();
  window.top.art.dialog({title:'<?php echo L('edit_announce')?>--'+title, id:'edit', iframe:'?m=Document&c=Convert&a=update&id='+id ,width:'500px',height:'250px'}, function(){var d = window.top.art.dialog({id:'edit'}).data.iframe;
  var form = d.document.getElementById('dosubmit');form.click();return false;}, function(){window.top.art.dialog({id:'edit'}).close()});
}
function deletes(id){
  if(confirm("<?php echo L('affirm_delete')?>") == true){
    window.location.href = "?m=Document&c=Convert&a=delete&id="+id;
  }
}
</script>
